package com.qf.controller;

import com.qf.pojo.reqVo.LiveUserReq;
import com.qf.pojo.respVo.BaseResp;
import com.qf.service.LiveUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 陌人不故
 * @Date: 2022/10/25/17:05
 */
@RequestMapping("/user")
@RestController
public class LiveUserController {

    @Autowired
    LiveUserService liveUserService;


    @RequestMapping("/validataEmail")
    public BaseResp validataEmail(@RequestParam("email") String eamil){
        return liveUserService.validataEmail(eamil);
    }

    @RequestMapping("/validataloginName")
    public BaseResp validataloginName(@RequestBody LiveUserReq liveUserReq){
        return liveUserService.validataloginName(liveUserReq);
    }

    @RequestMapping("/getCode")
    public BaseResp getCode(@RequestParam("email")String email){
        return liveUserService.getCode(email);
    }

    @RequestMapping("/registry")
    public BaseResp registry(@RequestBody LiveUserReq liveUserReq){
        return liveUserService.registry(liveUserReq);
    }


    @RequestMapping("/login")
    public BaseResp login(@RequestBody LiveUserReq liveUserReq){
        return liveUserService.login(liveUserReq);
    }


}
